package org.example.everyday;

/**
 * <p>
 * Description:TODO 详细描述
 * <p>
 * Copyright: 天津联想协同科技有限公司
 * <p>
 *
 * @author anlu
 * @date 2022/1/21 9:31
 */
public class Stone {

    public static void main(String[] args) {

        System.out.println("hello world");
        int[] array = new int[]{15,20,10,13,14,15,5,2,3};
        boolean result= solution(array);
        System.out.println(result);
    }

    public static boolean solution(int[] stones)
    {
        int[] oc = new int[3];
        for (int i : stones){
            oc[i%3]++;
        }

        //如果是3的倍数的石子是偶数
        if(oc[0] % 2 == 0){
            return oc[1]>0 && oc[2]>0;
        }

        return oc[1]-oc[2]>2 || oc[2]-oc[1]>2;
    }
}
